
/**
 * Class that represents a kind of product with their name, price and quantity, and a method to
 * calculate the total price of that product
 * @author JESUS
 *
 */
public class Product {
	
	private String name;
	private float price;
	private int quantity;
	
	/**
	 * Default constructor
	 * @param name
	 * @param price
	 * @param quantity
	 */
	public Product(String name, float price, int quantity) {
		this.name = name;
		this.price = price;
		this.quantity = quantity;
	}
	
	/**
	 * Method to calculate the total price of the products
	 * @param p
	 * @return
	 */
	public float TotalPrice (Product p){
		float total = 0;
		total = p.price * p.quantity;
		return total;
	}

	/**
	 * Getters & Setters
	 * @return
	 */
	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public float getPrice() {
		return price;
	}


	public void setPrice(float price) {
		this.price = price;
	}


	public int getQuantity() {
		return quantity;
	}


	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	/**
	 * ToString Method
	 */
	public String toString() {
		return "Product [name=" + name + ", price=" + price + ", quantity="
				+ quantity + "]";
	}

	
}
